import type { NobjcObject } from "objc-js";
import type { _NSString } from "../Foundation/NSString.js";
import type { _MTLAllocation } from "./MTLAllocation.js";
import type { _MTLDevice } from "./MTLDevice.js";
import type { _MTLHeap } from "./MTLHeap.js";
import type { MTLCPUCacheMode } from "./MTLCPUCacheMode.js";
import type { MTLHazardTrackingMode } from "./MTLHazardTrackingMode.js";
import type { MTLPurgeableState } from "./MTLPurgeableState.js";
import type { MTLResourceOptions } from "./MTLResourceOptions.js";
import type { MTLStorageMode } from "./MTLStorageMode.js";
export interface _MTLResource extends _MTLAllocation {
    /**
     * @method setPurgeableState @abstract Set (or query) the purgeability state of a resource @discussion Synchronously set the purgeability state of a resource and return what the prior (or current) state is. FIXME: If the device is keeping a cached copy of the resource, both the shared copy and cached copy are made purgeable. Any access to the resource by either the CPU or device will be undefined.
     */
    setPurgeableState$?(state: MTLPurgeableState): MTLPurgeableState;
    /**
     * @method makeAliasable @abstract Allow future heap sub-allocations to alias against this resource's memory. @discussion It is illegal to call this method on a non heap-based resource. It is also illegal to call this method on texture views created from heap-based textures. The debug layer will raise an exception. Calling this method on textures sub-allocated from Buffers backed by heap memory has no effect. Once a resource is made aliasable, the decision cannot be reverted.
     */
    makeAliasable?(): void;
    /**
     * @method isAliasable @abstract Returns whether future heap sub-allocations may alias against this resource's memory. @return YES if <st>makeAliasable</st> was previously successfully called on this resource. NO otherwise. If resource is sub-allocated from other resource created on the heap, isAliasable returns aliasing state of that base resource. Also returns NO when storage mode is memoryless.
     */
    isAliasable?(): boolean;
    /**
     * @method setOwnerWithIdentity: @abstract Assigns ownership of the resource's underlying memory to another task for the purposes of VM accounting.
     */
    setOwnerWithIdentity$?(task_id_token: NobjcObject): number;
    /** @property label @abstract A string to help identify this object. */
    label?(): _NSString | null;
    setLabel$?(value: _NSString | null): void;
    /**
     * @property device @abstract The device this resource was created against. This resource can only be used with this device.
     */
    device?(): _MTLDevice;
    /**
     * @property cpuCacheMode @abstract The cache mode used for the CPU mapping for this resource
     */
    cpuCacheMode?(): MTLCPUCacheMode;
    /**
     * @property storageMode @abstract The resource storage mode used for the CPU mapping for this resource
     */
    storageMode?(): MTLStorageMode;
    /**
     * @property hazardTrackingMode @abstract Whether or not the resource is hazard tracked. @discussion This value can be either MTLHazardTrackingModeUntracked or MTLHazardTrackingModeTracked. Resources created from heaps are by default untracked, whereas resources created from the device are by default tracked.
     */
    hazardTrackingMode?(): MTLHazardTrackingMode;
    /**
     * @property resourceOptions @abstract A packed tuple of the storageMode, cpuCacheMode and hazardTrackingMode properties.
     */
    resourceOptions?(): MTLResourceOptions;
    /**
     * @property heap @abstract The heap from which this resouce was created. @discussion Nil when this resource is not backed by a heap.
     */
    heap?(): _MTLHeap | null;
    /**
     * @property heapOffset @abstract The offset inside the heap at which this resource was created. @discussion Zero when this resource was not created on a heap with MTLHeapTypePlacement.
     */
    heapOffset?(): number;
    /** @property allocatedSize @abstract The size in bytes occupied by this resource */
    allocatedSize?(): number;
}
