summaryrefslogtreecommitdiff
path: root/chromium/tools/json_schema_compiler/dart_test/functions.idl
blob: e303d0de022711393638daa227bc56d0c0712cdc (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
// 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.

// A comment for the functions namespace.
namespace functions {
  callback SimpleCallback = void ();

  callback PrimitiveCallback = void (int i);

  callback DictCallback = void ([instanceOf=DictType] object dict);

  dictionary DictType {
    // A field.
    int a;

    // A parameter.
    static void voidFunc();
  };

  interface Functions {
    // Simple function.
    static void voidFunc();

    // Function taking a non-optional argument.
    static void argFunc(DOMString s);

    // Function taking an optional argument.
    static void optionalArgFunc(optional DOMString s);

    // Function taking a non-optional dictionary argument.
    static void dictArgFunc(DictType d);

    // Function taking an optional dictionary argument.
    static void optionalDictArgFunc(optional DictType d);

    // Function taking an entry argument.
    static void entryArgFunc([intanceOf=FileEntry] object entry);

    // Function taking a simple callback.
    static void callbackFunc(SimpleCallback c);

    // Function taking an optional simple callback.
    static void optionalCallbackFunc(optional SimpleCallback c);

    // Function taking a primitive callback.
    static void primitiveCallbackFunc(PrimitiveCallback c);

    // Function taking a dictionary callback.
    static void dictCallbackFunc(DictCallback c);

    // Function returning a dictionary.
    static DictType dictRetFunc();
  };
};