Skip to content

Commit

Permalink
Update IDL, prepare to release v0.3.0 (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo authored Oct 11, 2023
1 parent c786d74 commit d859db0
Show file tree
Hide file tree
Showing 28 changed files with 200 additions and 104 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ name: Publish
on:
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened, labeled, unlabeled]
push:
tags: [ 'v[0-9]+.[0-9]+.[0-9]+*' ]

jobs:
publish:
if: ${{ github.repository_owner == 'dart-lang' }}
uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main
with:
sdk: beta
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## 0.2.3-wip
## 0.3.0

- Updated source IDL to `v3.39.1`.
- Fixed a bug where `typedef`s were not declared with the IDL type's
nullability.
- Types that were aliased to `double` are now aliased to `num`. This is to make
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Lightweight DOM and JS bindings built around JS static interop.

<!-- START updated by /tool/update_bindings.dart. Do not modify by hand -->
Based on [`@webref/idl 3.38.2`](https://www.npmjs.com/package/@webref/idl/v/3.38.2)
Based on [`@webref/idl 3.39.1`](https://www.npmjs.com/package/@webref/idl/v/3.39.1)
<!-- END updated by /tool/update_bindings.dart. Do not modify by hand -->

NOTE: This package is highly experimental.
23 changes: 23 additions & 0 deletions lib/src/dom/audio_session.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:js_interop';

import 'dom.dart';
import 'html.dart';

typedef AudioSessionState = String;
typedef AudioSessionType = String;

@JS('AudioSession')
@staticInterop
class AudioSession implements EventTarget {}

extension AudioSessionExtension on AudioSession {
external set type(AudioSessionType value);
external AudioSessionType get type;
external AudioSessionState get state;
external set onstatechange(EventHandler value);
external EventHandler get onstatechange;
}
2 changes: 2 additions & 0 deletions lib/src/dom/clipboard_apis.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class ClipboardItem implements JSObject {
JSAny? items, [
ClipboardItemOptions options,
]);

external static bool supports(String type);
}

extension ClipboardItemExtension on ClipboardItem {
Expand Down
5 changes: 0 additions & 5 deletions lib/src/dom/css_font_loading.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class FontFaceDescriptors implements JSObject {
String weight,
String stretch,
String unicodeRange,
String variant,
String featureSettings,
String variationSettings,
String display,
Expand All @@ -39,8 +38,6 @@ extension FontFaceDescriptorsExtension on FontFaceDescriptors {
external String get stretch;
external set unicodeRange(String value);
external String get unicodeRange;
external set variant(String value);
external String get variant;
external set featureSettings(String value);
external String get featureSettings;
external set variationSettings(String value);
Expand Down Expand Up @@ -77,8 +74,6 @@ extension FontFaceExtension on FontFace {
external String get stretch;
external set unicodeRange(String value);
external String get unicodeRange;
external set variant(String value);
external String get variant;
external set featureSettings(String value);
external String get featureSettings;
external set variationSettings(String value);
Expand Down
16 changes: 16 additions & 0 deletions lib/src/dom/css_view_transitions_2.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:js_interop';

import 'css_view_transitions.dart';
import 'dom.dart';

@JS('PageRevealEvent')
@staticInterop
class PageRevealEvent implements Event {}

extension PageRevealEventExtension on PageRevealEvent {
external ViewTransition? get viewTransition;
}
19 changes: 11 additions & 8 deletions lib/src/dom/edit_context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import 'dom.dart';
import 'geometry.dart';
import 'html.dart';

typedef UnderlineStyle = String;
typedef UnderlineThickness = String;

@JS()
@staticInterop
@anonymous
Expand Down Expand Up @@ -131,8 +134,8 @@ class TextFormatInit implements JSObject {
external factory TextFormatInit({
int rangeStart,
int rangeEnd,
String underlineStyle,
String underlineThickness,
UnderlineStyle underlineStyle,
UnderlineThickness underlineThickness,
});
}

Expand All @@ -141,10 +144,10 @@ extension TextFormatInitExtension on TextFormatInit {
external int get rangeStart;
external set rangeEnd(int value);
external int get rangeEnd;
external set underlineStyle(String value);
external String get underlineStyle;
external set underlineThickness(String value);
external String get underlineThickness;
external set underlineStyle(UnderlineStyle value);
external UnderlineStyle get underlineStyle;
external set underlineThickness(UnderlineThickness value);
external UnderlineThickness get underlineThickness;
}

@JS('TextFormat')
Expand All @@ -156,8 +159,8 @@ class TextFormat implements JSObject {
extension TextFormatExtension on TextFormat {
external int get rangeStart;
external int get rangeEnd;
external String get underlineStyle;
external String get underlineThickness;
external UnderlineStyle get underlineStyle;
external UnderlineThickness get underlineThickness;
}

@JS()
Expand Down
14 changes: 9 additions & 5 deletions lib/src/dom/fenced_frame.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'html.dart';

typedef FencedFrameConfigSize = JSAny?;
typedef FencedFrameConfigURL = String;
typedef UrnOrConfig = JSAny?;
typedef ReportEventType = JSAny?;
typedef OpaqueProperty = String;
typedef FenceReportingDestination = String;
Expand Down Expand Up @@ -46,10 +47,11 @@ extension FencedFrameConfigExtension on FencedFrameConfig {
@anonymous
class FenceEvent implements JSObject {
external factory FenceEvent({
required String eventType,
required String eventData,
required JSArray destination,
String eventType,
String eventData,
JSArray destination,
bool once,
String destinationURL,
});
}

Expand All @@ -62,14 +64,16 @@ extension FenceEventExtension on FenceEvent {
external JSArray get destination;
external set once(bool value);
external bool get once;
external set destinationURL(String value);
external String get destinationURL;
}

@JS('Fence')
@staticInterop
class Fence implements JSObject {}

extension FenceExtension on Fence {
external JSVoid reportEvent(ReportEventType event);
external JSVoid setReportEventDataForAutomaticBeacons(FenceEvent event);
external JSVoid reportEvent([ReportEventType event]);
external JSVoid setReportEventDataForAutomaticBeacons([FenceEvent event]);
external JSArray getNestedConfigs();
}
3 changes: 3 additions & 0 deletions lib/src/dom/fetch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ class RequestInit implements JSObject {
RequestPriority priority,
JSAny? window,
RequestTargetAddressSpace targetAddressSpace,
bool sharedStorageWritable,
PrivateToken privateToken,
});
}
Expand Down Expand Up @@ -149,6 +150,8 @@ extension RequestInitExtension on RequestInit {
external JSAny? get window;
external set targetAddressSpace(RequestTargetAddressSpace value);
external RequestTargetAddressSpace get targetAddressSpace;
external set sharedStorageWritable(bool value);
external bool get sharedStorageWritable;
external set privateToken(PrivateToken value);
external PrivateToken get privateToken;
}
Expand Down
17 changes: 15 additions & 2 deletions lib/src/dom/html.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import 'dart:js_interop';

import 'attribution_reporting_api.dart';
import 'audio_session.dart';
import 'autoplay_detection.dart';
import 'badging.dart';
import 'clipboard_apis.dart';
Expand Down Expand Up @@ -698,7 +699,11 @@ extension HTMLSourceElementExtension on HTMLSourceElement {

@JS('HTMLImageElement')
@staticInterop
class HTMLImageElement implements HTMLElement, HTMLAttributionSrcElementUtils {
class HTMLImageElement
implements
HTMLElement,
HTMLAttributionSrcElementUtils,
HTMLSharedStorageWritableElementUtils {
external factory HTMLImageElement();
}

Expand Down Expand Up @@ -754,7 +759,8 @@ extension HTMLImageElementExtension on HTMLImageElement {

@JS('HTMLIFrameElement')
@staticInterop
class HTMLIFrameElement implements HTMLElement {
class HTMLIFrameElement
implements HTMLElement, HTMLSharedStorageWritableElementUtils {
external factory HTMLIFrameElement();
}

Expand Down Expand Up @@ -1917,6 +1923,8 @@ class HTMLDetailsElement implements HTMLElement {
}

extension HTMLDetailsElementExtension on HTMLDetailsElement {
external set name(String value);
external String get name;
external set open(bool value);
external bool get open;
}
Expand Down Expand Up @@ -3903,6 +3911,10 @@ extension NavigatorExtension on Navigator {
String keySystem,
JSArray supportedConfigurations,
);
external JSPromise deprecatedReplaceInURN(
UrnOrConfig urnOrConfig,
JSAny? replacements,
);
external JSArray getGamepads();
external JSPromise getInstalledRelatedApps();
external JSVoid getUserMedia(
Expand All @@ -3918,6 +3930,7 @@ extension NavigatorExtension on Navigator {
external JSPromise share([ShareData data]);
external bool canShare([ShareData data]);
external JSPromise requestMIDIAccess([MIDIOptions options]);
external AudioSession get audioSession;
external Clipboard get clipboard;
external ContactsManager get contacts;
external CredentialsContainer get credentials;
Expand Down
4 changes: 4 additions & 0 deletions lib/src/dom/intersection_observer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ extension IntersectionObserverExtension on IntersectionObserver {
external JSArray takeRecords();
external JSAny? get root;
external String get rootMargin;
external String get scrollMargin;
external JSArray get thresholds;
}

Expand Down Expand Up @@ -86,6 +87,7 @@ class IntersectionObserverInit implements JSObject {
external factory IntersectionObserverInit({
JSAny? root,
String rootMargin,
String scrollMargin,
JSAny? threshold,
});
}
Expand All @@ -95,6 +97,8 @@ extension IntersectionObserverInitExtension on IntersectionObserverInit {
external JSAny? get root;
external set rootMargin(String value);
external String get rootMargin;
external set scrollMargin(String value);
external String get scrollMargin;
external set threshold(JSAny? value);
external JSAny? get threshold;
}
10 changes: 10 additions & 0 deletions lib/src/dom/shared_storage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,13 @@ extension WorkletSharedStorageExtension on WorkletSharedStorage {
external JSPromise length();
external JSPromise remainingBudget();
}

@JS('HTMLSharedStorageWritableElementUtils')
@staticInterop
class HTMLSharedStorageWritableElementUtils implements JSObject {}

extension HTMLSharedStorageWritableElementUtilsExtension
on HTMLSharedStorageWritableElementUtils {
external set sharedStorageWritable(bool value);
external bool get sharedStorageWritable;
}
12 changes: 3 additions & 9 deletions lib/src/dom/storage_buckets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import 'hr_time.dart';
import 'indexeddb.dart';
import 'service_workers.dart';

typedef StorageBucketDurability = String;

@JS('NavigatorStorageBuckets')
@staticInterop
class NavigatorStorageBuckets implements JSObject {}
Expand All @@ -36,18 +34,15 @@ extension StorageBucketManagerExtension on StorageBucketManager {
@anonymous
class StorageBucketOptions implements JSObject {
external factory StorageBucketOptions({
bool? persisted,
StorageBucketDurability? durability,
bool persisted,
int? quota,
DOMHighResTimeStamp? expires,
});
}

extension StorageBucketOptionsExtension on StorageBucketOptions {
external set persisted(bool? value);
external bool? get persisted;
external set durability(StorageBucketDurability? value);
external StorageBucketDurability? get durability;
external set persisted(bool value);
external bool get persisted;
external set quota(int? value);
external int? get quota;
external set expires(DOMHighResTimeStamp? value);
Expand All @@ -62,7 +57,6 @@ extension StorageBucketExtension on StorageBucket {
external JSPromise persist();
external JSPromise persisted();
external JSPromise estimate();
external JSPromise durability();
external JSPromise setExpires(DOMHighResTimeStamp expires);
external JSPromise expires();
external JSPromise getDirectory();
Expand Down
4 changes: 4 additions & 0 deletions lib/src/dom/streams.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ typedef UnderlyingSinkAbortCallback = JSFunction;
typedef TransformerStartCallback = JSFunction;
typedef TransformerFlushCallback = JSFunction;
typedef TransformerTransformCallback = JSFunction;
typedef TransformerCancelCallback = JSFunction;
typedef QueuingStrategySize = JSFunction;
typedef ReadableStreamReaderMode = String;
typedef ReadableStreamType = String;
Expand Down Expand Up @@ -317,6 +318,7 @@ class Transformer implements JSObject {
TransformerStartCallback start,
TransformerTransformCallback transform,
TransformerFlushCallback flush,
TransformerCancelCallback cancel,
JSAny? readableType,
JSAny? writableType,
});
Expand All @@ -329,6 +331,8 @@ extension TransformerExtension on Transformer {
external TransformerTransformCallback get transform;
external set flush(TransformerFlushCallback value);
external TransformerFlushCallback get flush;
external set cancel(TransformerCancelCallback value);
external TransformerCancelCallback get cancel;
external set readableType(JSAny? value);
external JSAny? get readableType;
external set writableType(JSAny? value);
Expand Down
Loading

0 comments on commit d859db0

Please sign in to comment.