import { IEventDispatcher } from '../events/IEventDispatcher';
import { AbstractionBase } from './AbstractionBase';
import { IAbstractionPool } from './IAbstractionPool';

import { IAssetAdapter } from './IAssetAdapter';

export interface IAsset extends IEventDispatcher
{
	finalizer: FinalizationRegistry<number>;

	adapter: IAssetAdapter;

	/**
	 *
	 */
	name: string;

	/**
	 *
	 */
	id: number;

	/**
	 *
	 */
	assetNamespace: string;

	/**
	 *
	 */
	assetType: string;

	/**
	 *
	 * @param name
	 * @param ns
	 */
	assetPathEquals(name: string, ns: string): boolean;

	/**
     *
     */
	clone(): IAsset;

	/**
	 *
	 */
	invalidate();

	/**
	 *
	 * @param IAssetClass
	 */
	isAsset(IAssetClass): boolean;

	/**
	 *
	 * @param name
	 * @param ns
	 * @param overrideOriginal
	 */
	resetAssetPath(name: string, ns: string, overrideOriginal?: boolean): void;

	getAbstraction<T extends AbstractionBase>(abstractionGroup: IAbstractionPool): T;

	checkAbstraction <T extends AbstractionBase>(pool: IAbstractionPool): T;

	clearAbstraction(pool: IAbstractionPool | number);
}
