import type { _NSArray } from "../Foundation/NSArray.js";
import type { _NSError } from "../Foundation/NSError.js";
import type { _NSObject } from "../Foundation/NSObject.js";
import type { _AVPlayerItem } from "./AVPlayerItem.js";
import type { _AVQueuePlayer } from "./AVQueuePlayer.js";
import type { CMTimeRange } from "../structs/CMTimeRange.js";
import type { AVPlayerLooperItemOrdering } from "./AVPlayerLooperItemOrdering.js";
import type { AVPlayerLooperStatus } from "./AVPlayerLooperStatus.js";
export declare class _AVPlayerLooper extends _NSObject {
    static alloc(): _AVPlayerLooper;
    static new(): _AVPlayerLooper;
    init(): _AVPlayerLooper;
    /**
     * @method playerLooperWithPlayer:templateItem:timeRange: @abstract Returns an instance of AVPlayerLooper to loop specified AVPlayerItem within the specified time range with specified AVQueuePlayer. @param player Must not be nil @param itemToLoop Must not be nil @param loopRange Playback time range in [0, itemToLoop's duration]. kCMTimeRangeInvalid means [0, itemToLoop's duration]. @result An instance of AVPlayerLooper. @discussion The specified AVPlayerItem will be used as a template to generate at least 3 AVPlayerItem replicas and the replicas will be inserted into specified AVQueuePlayer's play queue to accomplish the looping playback. The specified AVPlayerItem should have its asset's duration property loaded beforehand so looping setup work would not be blocked until the duration value is known. Otherwise, AVPlayerLooper's status property is AVPlayerLooperStatusUnknown until the duration property is loaded. The specified AVPlayerItem will not be used in the actual looping playback. Furthermore, AVPlayerItem replicas will be generated at initialization time so any changes made to the specified AVPlayerItem's property afterwards will not be reflected in the replicas used for looping playback. Specified CMTimeRange will limit each item loop iteration to playing within the specified time range. To play from beginning and the whole duration of the item, specify kCMTimeRangeInvalid for the range parameter. Time range will be accomplished by seeking to range start time and setting AVPlayerItem's forwardPlaybackEndTime property on the looping item replicas. Client should not modify AVQueuePlayer's play queue while AVPlayerLooper is performing the looping. AVPlayerLooper will insert the replica items before any existing items in the specified AVQueuePlayer's play queue and change the actionAtItemEnd to AVPlayerActionAtItemEndAdvance if required. AVQueuePlayer's play queue and actionAtItemEnd will be restored when -disableLooping method is called and then current looping item replicas completes playback or when AVPlayerLooper is destroyed. While AVPlayerLooper is being initialized, the specified AVQueuePlayer will be paused (rate of 0.0) if necessary and the original player rate will be restored after initialization completes. The client shall set the specified AVQueuePlayer's rate to 0 beforehand if additional set-up work needs to be performed after AVPlayerLooper initialization and before starting looping playback. An NSInvalidArgumentException will be raised if the player and template item are not specified or the template item has a 0 duration. An NSInvalidArgumentException will be raised if a valid time range has a duration of 0 or is not contained within time 0 and duration of the templateItem.
     */
    static playerLooperWithPlayer$templateItem$timeRange$(player: _AVQueuePlayer, itemToLoop: _AVPlayerItem, loopRange: CMTimeRange): _AVPlayerLooper;
    /**
     * @method playerLooperWithPlayer:templateItem: @abstract Returns an instance of AVPlayerLooper to loop specified AVPlayerItem with specified AVQueuePlayer. @param player Must not be nil @param itemToLoop Must not be nil @result An instance of AVPlayerLooper. @discussion Equivalent to +playerLooperWithPlayer:templateItem:timeRange: and passing in kCMTimeRangeInvalid for timeRange parameter.
     */
    static playerLooperWithPlayer$templateItem$(player: _AVQueuePlayer, itemToLoop: _AVPlayerItem): _AVPlayerLooper;
    /**
     * @method initWithPlayer:templateItem:timeRange: @abstract Initializes an instance of AVPlayerLooper to loop specified AVPlayerItem within specified time range with specified AVQueuePlayer. @param player Must not be nil @param itemToLoop Must not be nil @param loopRange Playback time range in [0, itemToLoop's duration]. kCMTimeRangeInvalid means [0, itemToLoop's duration]. @result An initialized AVPlayerLooper. @discussion Equivalent to -initWithPlayer:templateItem:timeRange:existingItemsOrdering: and passing AVPlayerLooperItemOrderingLoopingItemsPrecedeExistingItems as the beforeOrAfter parameter.
     */
    initWithPlayer$templateItem$timeRange$(player: _AVQueuePlayer, itemToLoop: _AVPlayerItem, loopRange: CMTimeRange): _AVPlayerLooper;
    /**
     * @method initWithPlayer:templateItem:timeRange:existingItemsOrdering: @abstract Initializes an instance of AVPlayerLooper to loop specified AVPlayerItem within specified time range with specified AVQueuePlayer and adhering to specified ordering of existing items in the play queue. @param player Must not be nil @param itemToLoop Must not be nil @param loopRange Playback time range in [0, itemToLoop's duration]. kCMTimeRangeInvalid means [0, itemToLoop's duration]. @param itemOrdering Specifes if replica items are to be inserted before or after existing items in the specified AVQueuePlayer. @result An initialized AVPlayerLooper. @discussion The specified AVPlayerItem will be used as a template to generate at least 3 AVPlayerItem replicas and the replicas will be inserted into specified AVQueuePlayer's play queue to accomplish the looping playback. The specified AVPlayerItem should have its asset's duration property loaded beforehand so looping setup work would not be blocked until the duration value is known. Otherwise, AVPlayerLooper's status property is AVPlayerLooperStatusUnknown until the duration property is loaded. The specified AVPlayerItem will not be used in the actual looping playback. Furthermore, AVPlayerItem replicas will be generated at initialization time so any changes made to the specified AVPlayerItem's property afterwards will not be reflected in the replicas used for looping playback. Specified CMTimeRange will limit each item loop iteration to playing within the specified time range. To play from beginning and the whole duration of the item, specify kCMTimeRangeInvalid for the range parameter. Time range will be accomplished by seeking to range start time and setting AVPlayerItem's forwardPlaybackEndTime property on the looping item replicas. Client should not modify AVQueuePlayer's play queue while AVPlayerLooper is performing the looping. AVPlayerLooper will insert the replica items in the specified AVQueuePlayer's play queue before or after existing equeued items according to the specified AVPlayerLooperItemOrdering. The looper will change the actionAtItemEnd to AVPlayerActionAtItemEndAdvance if required. AVQueuePlayer's play queue and actionAtItemEnd will be restored when -disableLooping method is called and then current looping item replicas completes playback or when AVPlayerLooper is destroyed. While AVPlayerLooper is being initialized, the specified AVQueuePlayer will be paused (rate of 0.0) if necessary and the original player rate will be restored after initialization completes. The client shall set the specified AVQueuePlayer's rate to 0 beforehand if additional set-up work needs to be performed after AVPlayerLooper initialization and before starting looping playback. An NSInvalidArgumentException will be raised if the player and template item are not specified or the template item has a 0 duration. An NSInvalidArgumentException will be raised if a valid time range has a duration of 0 or is not contained within time 0 and duration of the templateItem.
     */
    initWithPlayer$templateItem$timeRange$existingItemsOrdering$(player: _AVQueuePlayer, itemToLoop: _AVPlayerItem, loopRange: CMTimeRange, itemOrdering: AVPlayerLooperItemOrdering): _AVPlayerLooper;
    /**
     * @method disableLooping @abstract Disables the item looping @discussion AVPlayerLooper will stop performing player queue operations for looping and let the current looping item replica play to the end. The player's original actionAtItemEnd property will be restored afterwards. After this method is called, the value of the receiver's status property will be AVPlayerLooperStatusCancelled.
     */
    disableLooping(): void;
    /**
     * @property status @abstract The ability of the receiver to be used for looping playback. @discussion The value of this property is an AVPlayerLooperStatus that indicates whether the receiver is ready for looping playback. When the value of this property is AVPlayerStatusFailed, the receiver can no longer be used for playback and a new instance needs to be created in its place. When this happens, clients can check the value of the error property to determine the nature of the failure. This property is key value observable.
     */
    status(): AVPlayerLooperStatus;
    /**
     * @property error @abstract If the receiver's status is AVPlayerLooperStatusFailed, this describes the error that caused the failure. @discussion The value of this property is a NSError that describes what caused the receiver to not be able to perform looping playback. If the receiver's status is not AVPlayerLooperStatusFailed, the value of this property is nil.
     */
    error(): _NSError | null;
    /**
     * @property loopCount @abstract Number of times the specified AVPlayerItem has been played @discussion Starts at 0 and increments when the player starts playback of the AVPlayerItem again. This property is key value observable.
     */
    loopCount(): number;
    /**
     * @property loopingPlayerItems @abstract Returns an array containing replicas of specified AVPlayerItem used to accomplish the looping @discussion AVPlayerLooper creates replicas of the template AVPlayerItem using -copyWithZone: and inserts the replicas in the specified AVQueuePlayer to accomplish the looping. The AVPlayerItem replicas are for informational purposes and to allow the client to apply properties that are not transferred from the template AVPlayerItem to the replicas. The client can determine the number of replicas created and can listen for notifications and property changes from the replicas if desired. AVPlayerItemOutputs and AVPlayerItemMediaDataCollectors are not transferred to the replicas so the client should add them to each replica if desired. The client shall not modify the properties on the replicas that would disrupt looping playback. Examples of such properties are playhead time/date, selected media option, and forward playback end time. This property is key value observable. @result Array containing replicas of specified AVPlayerItem
     */
    loopingPlayerItems(): _NSArray;
}
