You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ha...@apache.org on 2019/12/24 21:25:06 UTC

[royale-typedefs] branch develop updated: Fixed GCL typedefs

This is an automated email from the ASF dual-hosted git repository.

harbs pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-typedefs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 08910de  Fixed GCL typedefs
08910de is described below

commit 08910dee6ef04de733e8788eacdb9aa618f4faf8
Author: Harbs <ha...@in-tools.com>
AuthorDate: Tue Dec 24 23:24:52 2019 +0200

    Fixed GCL typedefs
---
 GCL/src/main/royale/goog/events/Event.as       |   4 +
 GCL/src/main/royale/goog/events/EventTarget.as |   2 +-
 GCL/src/main/royale/goog/events/Listener.as    | 164 +++++++++++++++++++++++++
 3 files changed, 169 insertions(+), 1 deletion(-)

diff --git a/GCL/src/main/royale/goog/events/Event.as b/GCL/src/main/royale/goog/events/Event.as
index ec04192..56c85cb 100644
--- a/GCL/src/main/royale/goog/events/Event.as
+++ b/GCL/src/main/royale/goog/events/Event.as
@@ -60,6 +60,10 @@ public class Event {
     public function stopPropagation():void {}
     public function preventDefault():void {}
 
+    public function get propagationStopped_():Boolean{
+        return false;
+    }
+
     /**
      * Stops the propagation of the event. It is equivalent to
      * {@code e.stopPropagation()}, but can be used as the callback argument of
diff --git a/GCL/src/main/royale/goog/events/EventTarget.as b/GCL/src/main/royale/goog/events/EventTarget.as
index 2c328e2..ff73f7e 100644
--- a/GCL/src/main/royale/goog/events/EventTarget.as
+++ b/GCL/src/main/royale/goog/events/EventTarget.as
@@ -207,7 +207,7 @@ public class EventTarget extends Disposable implements Listenable {
      * @see [eventtarget]
      * @returns {boolean} If anyone called preventDefault on the event object (or if any of the listeners returns false) this will also return false.
      */
-    public static function dispatchEventInternal_(target:Object, e:Object, opt_ancestorsTree:Array = null):Boolean {  return false }
+    public static var dispatchEventInternal_:Function;
 
     /**
      * @see [eventtarget]
diff --git a/GCL/src/main/royale/goog/events/Listener.as b/GCL/src/main/royale/goog/events/Listener.as
new file mode 100644
index 0000000..9307575
--- /dev/null
+++ b/GCL/src/main/royale/goog/events/Listener.as
@@ -0,0 +1,164 @@
+// Copyright 2005 The Closure Library Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS-IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @fileoverview Listener object.
+ * @see ../demos/events.html
+ */
+
+package goog.events {
+
+
+  /**
+   * Simple class that stores information about a listener
+   * @param {function(?):?} listener Callback function.
+   * @param {Function} proxy Wrapper for the listener that patches the event.
+   * @param {EventTarget|goog.events.Listenable} src Source object for
+   *     the event.
+   * @param {string} type Event type.
+   * @param {boolean} capture Whether in capture or bubble phase.
+   * @param {Object=} opt_handler Object in whose context to execute the callback.
+   * @implements {goog.events.ListenableKey}
+   * @constructor
+   */
+  public class Listener implements ListenableKey{
+    public function Listener(listener:Function,proxy:Function,src:EventTarget,type:String,capture:Boolean,opt_handler:Object = null){
+      super();
+    }
+
+    /**
+     * Whether the listener works on capture phase.
+     *
+     * @see JSType - [boolean] 
+     * @see [listenable]
+     */
+    public function get capture():Boolean{
+      return false;
+    }
+    public function set capture(value:Boolean):void{
+
+    }
+
+    /**
+     * The listener function.
+     *
+     * @see JSType - [(function (?): ?|null|{handleEvent: function (?): ?})] 
+     * @see [listenable]
+     */
+    public function get listener():Object{
+      return null;
+    }
+    public function set listener(value:Object):void{
+
+    }
+
+    /**
+     * The source event target.
+     *
+     * @see JSType - [(Object|goog.events.EventTarget|goog.events.Listenable)] 
+     * @see [listenable]
+     */
+    public function get src():Object{
+      return null;
+    }
+    public function set src(value:Object):void{
+
+    }
+
+    /**
+     * The event type the listener is listening to.
+     *
+     * @see JSType - [string] 
+     * @see [listenable]
+     */
+    public function get type():String{
+      return null;
+    }
+    public function set type(value:String):void{
+
+    }
+
+    /**
+     * A globally unique number to identify the key.
+     *
+     * @see JSType - [number] 
+     * @see [listenable]
+     */
+    public function get key():Number{
+      return 0;
+    }
+    public function set key(value:Number):void{
+
+    }
+
+    /**
+     * The 'this' object for the listener function's scope.
+     *
+     * @see JSType - [(Object|null)] 
+     * @see [listenable]
+     */
+    public function get handler():Object{
+      return null;
+    }
+    public function set handler(value:Object):void{
+
+    }
+
+    /**
+     * Reserves a key to be used for ListenableKey#key field.
+     *
+     * @see [listenable]
+     * @returns {number} A number to be used to fill ListenableKey#key field.
+     */
+    public function reserveKey():Number{
+      return 0;
+    }
+
+      /**
+       * A wrapper over the original listener. This is used solely to
+       * handle native browser events (it is used to simulate the capture
+       * phase and to patch the event object).
+       * @type {Function}
+       */
+    public var proxy:Function;
+
+      /**
+       * Whether to remove the listener after it has been called.
+       * @type {boolean}
+       */
+    public var callOnce:Boolean;
+
+      /**
+       * Whether the listener has been removed.
+       * @type {boolean}
+       */
+    public var removed:Boolean;
+
+    /**
+     * If monitoring the goog.events.Listener instances is enabled, stores the
+     * creation stack trace of the Disposable instance.
+     * @type {string}
+     */
+    public var creationStack:String;
+
+    /**
+     * Marks this listener as removed. This also remove references held by
+     * this listener object (such as listener and event source).
+     */
+    public function markAsRemoved():void {
+    }
+
+  }
+}
+