### YAML Configuration: Input Files Example Source: https://github.com/dart-lang/web/blob/main/js_interop_gen/README.md Example of specifying input files in the YAML configuration. Can be a single string or an array of strings. ```yaml input: bindings.d.ts ``` ```yaml input: - bindings.d.ts ``` -------------------------------- ### YAML Configuration: Include Declarations Example Source: https://github.com/dart-lang/web/blob/main/js_interop_gen/README.md Example of specifying which declarations to include using a raw string or a regular expression in the YAML configuration. ```yaml include: - myNumber ``` -------------------------------- ### YAML Configuration: Preamble Example Source: https://github.com/dart-lang/web/blob/main/js_interop_gen/README.md Example of setting a preamble string in the YAML configuration. The pipe symbol indicates a literal block scalar. ```yaml preamble: | // Generated. Do not edit. ``` -------------------------------- ### YAML Configuration: Variadic Function Arguments Source: https://github.com/dart-lang/web/blob/main/js_interop_gen/README.md Example of configuring the number of arguments for variadic functions in the YAML configuration. ```yaml functions: varargs: 6 ``` -------------------------------- ### Get Help for js_interop_gen Source: https://github.com/dart-lang/web/blob/main/js_interop_gen/README.md Use this command to view all available command-line options for the js_interop_gen tool. ```shell dart run js_interop_gen --help ``` -------------------------------- ### YAML Configuration: TypeScript Compiler Options Source: https://github.com/dart-lang/web/blob/main/js_interop_gen/README.md Example of embedding TypeScript compiler options within the YAML configuration file. ```yaml ts_config: compilerOptions: target: es2020 ``` -------------------------------- ### YAML Configuration for js_interop_gen Source: https://github.com/dart-lang/web/blob/main/js_interop_gen/README.md Example of a YAML configuration file for js_interop_gen. This file specifies input, output, and TypeScript compiler options. ```yaml input: a.d.ts output: b.d.ts ts-config-file: tsconfig.json ``` -------------------------------- ### Equivalent CLI and YAML Configuration Source: https://github.com/dart-lang/web/blob/main/js_interop_gen/README.md Demonstrates how to achieve the same configuration using either command-line flags or a YAML configuration file. ```shell dart run js_interop_gen -o b.d.ts --ts-config tsconfig.json a.d.ts ``` ```shell dart run js_interop_gen --config config.yaml ``` -------------------------------- ### Generate All Bindings (Ignoring Compatibility) Source: https://github.com/dart-lang/web/blob/main/web_generator/README.md Use the --generate-all flag to emit all members, ignoring compatibility data. This is useful for experimental or non-standard APIs. ```shell dart bin/update_idl_bindings.dart --generate-all ``` -------------------------------- ### Basic DOM Manipulation with package:web Source: https://github.com/dart-lang/web/blob/main/web/README.md Demonstrates setting the text content of an HTML element using package:web. Ensure the 'web' package is imported. ```dart import 'package:web/web.dart'; void main() { final div = document.querySelector('div')!; div.text = 'Text set at ${DateTime.now()}'; } ``` -------------------------------- ### Generate Dart Interfaces from IDL Source: https://github.com/dart-lang/web/blob/main/web_generator/README.md Run this command at the root of the package to generate Dart interfaces from .idl files. If multiple files are provided, the output option is treated as an output directory. ```shell dart bin/update_idl_bindings.dart ``` -------------------------------- ### Run Dart Fix Tests Source: https://github.com/dart-lang/web/blob/main/web/test_fixes/README.md Navigate to the test_fixes directory and execute the dart fix command with the --compare-to-golden flag to test fixes manually. ```bash > cd test_fixes > dart fix --compare-to-golden ``` -------------------------------- ### Update to Latest Web IDL Versions Source: https://github.com/dart-lang/web/blob/main/web_generator/README.md Use the --update flag to regenerate package bindings from the latest IDL versions. Alternatively, manually edit package.json and re-run the script. ```shell dart bin/update_idl_bindings.dart --update ``` -------------------------------- ### Generate Dart Interfaces from TS Declarations Source: https://github.com/dart-lang/web/blob/main/js_interop_gen/README.md Run this command to generate Dart interfaces from a .d.ts file. Specify an output directory with the -o flag if needed. ```shell dart run js_interop_gen ``` ```shell dart run js_interop_gen -o ``` -------------------------------- ### Scrape MDN Documentation Source: https://github.com/dart-lang/web/blob/main/web_generator/README.md Collects MDN documentation into mdn.json to update dartdoc comments. After running this, you must re-run update_idl_bindings.dart to use the updated documentation. ```shell dart bin/scrape_mdn.dart ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.