summaryrefslogtreecommitdiffstats
path: root/tools/json_schema_compiler/dart_test/events.idl
blob: f1fb4b67dcc685125495dd7ea156ed664076017c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This comment is for the events namespace.
namespace events {
  dictionary EventArgumentElement {
    DOMString elementStringArg;
  };

  dictionary EventArgument {
    // A file entry
    [instanceOf=FileEntry] object entryArg;

    // A string
    DOMString stringArg;

    // A primitive
    int intArg;

    // An array
    EventArgumentElement[] elements;

    // Optional file entry
    [instanceOf=FileEntry] object? optionalEntryArg;

    // A string
    DOMString? optionalStringArg;

    // A primitive
    int? optionalIntArg;

    // An array
    EventArgumentElement[]? optionalElements;
  };

  interface Events {
    // Documentation for the first basic event.
    static void firstBasicEvent();

    // Documentation for the second basic event.
    static void secondBasicEvent();

    // Documentation for an event with a non-optional primitive argument.
    static void nonOptionalPrimitiveArgEvent(int argument);

    // Documentation for an event with an optional primitive argument.
    static void optionalPrimitiveArgEvent(optional int argument);

    // Documentation for an event with a non-optional dictionary argument.
    static void nonOptionalDictArgEvent(EventArgument argument);

    // Documentation for an event with a optional dictionary argument.
    static void optionalDictArgEvent(EventArgument argument);
  };
};