blob: cd522598ff3b9f13a2436fb8ca7935ab3d0eaa8c [file] [log] [blame]
/**
* @license
* Copyright (C) 2020 The Android Open Source Project
*
* 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.
*/
export interface AttributeHelperPluginApi {
/**
* Binds callback to property updates.
*
* @param name Property name.
* @return Unbind function.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
bind(name: string, callback: (value: any) => void): () => any;
/**
* Get value of the property from wrapped object. Waits for the property
* to be initialized if it isn't defined.
*/
get(name: string): Promise<unknown>;
/**
* Sets value and dispatches event to force notify.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
set(name: string, value: any): void;
}