Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/remote/test/puppeteer/test-d/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  JSHandle.test-d.ts

  Sprache: JAVA
 

/**
 * @license
 * Copyright 2024 Google Inc.
 * SPDX-License-Identifier: Apache-2.0
 */

import type {ElementHandle, JSHandle} from 'puppeteer';
import {expectNotAssignable, expectNotType, expectType} from 'tsd';

declare const handle: JSHandle;

{
  expectType<unknown>(await handle.evaluate('document'));
  expectType<number>(
    await handle.evaluate(() => {
      return 1;
    }),
  );
  expectType<HTMLElement>(
    await handle.evaluate(() => {
      return document.body;
    }),
  );
  expectType<string>(
    await handle.evaluate(() => {
      return '';
    }),
  );
  expectType<string>(
    await handle.evaluate((value, str) => {
      expectNotAssignable<never>(value);
      expectType<string>(str);
      return '';
    }, ''),
  );
}

{
  expectType<JSHandle>(await handle.evaluateHandle('document'));
  expectType<JSHandle<number>>(
    await handle.evaluateHandle(() => {
      return 1;
    }),
  );
  expectType<JSHandle<string>>(
    await handle.evaluateHandle(() => {
      return '';
    }),
  );
  expectType<JSHandle<string>>(
    await handle.evaluateHandle((value, str) => {
      expectNotAssignable<never>(value);
      expectType<string>(str);
      return '';
    }, ''),
  );
  expectType<ElementHandle<HTMLElement>>(
    await handle.evaluateHandle(() => {
      return document.body;
    }),
  );
}

declare const handle2: JSHandle<{test: number}>;

{
  {
    expectType<JSHandle<number>>(await handle2.getProperty('test'));
    expectNotType<JSHandle<unknown>>(await handle2.getProperty('test'));
  }
  {
    expectType<JSHandle<unknown>>(
      await handle2.getProperty('key-doesnt-exist'),
    );
    expectNotType<JSHandle<string>>(
      await handle2.getProperty('key-doesnt-exist'),
    );
    expectNotType<JSHandle<number>>(
      await handle2.getProperty('key-doesnt-exist'),
    );
  }
}

{
  void handle.evaluate((value, other) => {
    expectType<unknown>(value);
    expectType<{test: number}>(other);
  }, handle2);
}

Messung V0.5 in Prozent
C=97 H=79 G=88

¤ Dauer der Verarbeitung: 0.9 Sekunden  (vorverarbeitet am  2026-06-04) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.