mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-16 16:16:40 +03:00
8ba088a38f
We were not able to get our externs generated by the Closure compiler. There were many issues with the Closure-generated externs, including the order of the externs and the replacement of record types and enums with their underlying types. We made a few attempts to patch the compiler, but could not get our patches accepted upstream. This change introduces a new script to generate our externs from scratch. It uses a JavaScript parser called 'esprima'. Some interfaces need to be exported to the generated externs, but are not actually attached to the namespace by the compiler. For this, we introduce a new annotation. These are the currently-supported export annotations: - @export: truly exported (attached to namespace) by the compiler - @expose: truly exposed (not renamed) by the compiler - @exportDoc: considered part of the exports in the docs - @exportInterface: considered part of the exports in generated externs These annotations are now documented in docs/design/export.md Change-Id: I33bf7384889c14c9edb0fa5f11caa7c4f4d79af6
39 lines
1.1 KiB
JavaScript
39 lines
1.1 KiB
JavaScript
/**
|
|
* @license
|
|
* Copyright 2016 Google Inc.
|
|
*
|
|
* 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.
|
|
*/
|
|
|
|
goog.provide('shaka.util.IDestroyable');
|
|
|
|
|
|
|
|
/**
|
|
* An interface to standardize how objects are destroyed.
|
|
* @interface
|
|
* @exportInterface
|
|
*/
|
|
shaka.util.IDestroyable = function() {};
|
|
|
|
|
|
/**
|
|
* Destroys the object, releasing all resources and shutting down all
|
|
* operations. Returns a Promise which is resolved when destruction is
|
|
* complete. This Promise should never be rejected.
|
|
*
|
|
* @return {!Promise}
|
|
* @exportInterface
|
|
*/
|
|
shaka.util.IDestroyable.prototype.destroy = function() {};
|