mirror of
				https://github.com/Ukendio/jecs.git
				synced 2025-11-03 18:39:19 +00:00 
			
		
		
		
	Separate Iter from IterFn (#267)
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	
* Separate Iter from IterFn * Clean up
This commit is contained in:
		
							parent
							
								
									0bc1848554
								
							
						
					
					
						commit
						bd00edc8c0
					
				
					 1 changed files with 11 additions and 3 deletions
				
			
		
							
								
								
									
										14
									
								
								jecs.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								jecs.d.ts
									
									
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -56,13 +56,21 @@ export type Archetype<T extends Id[]> = {
 | 
			
		|||
	columns_map: { [K in T[number]]: Column<InferComponent<K>> };
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
type Iter<T extends Id[]> = IterableFunction<LuaTuple<[Entity, ...InferComponents<T>]>>;
 | 
			
		||||
type IterFn<T extends Id[]> = IterableFunction<LuaTuple<[Entity, ...InferComponents<T>]>>;
 | 
			
		||||
type Iter<T extends Id[]> = IterFn<T> & {
 | 
			
		||||
	/**
 | 
			
		||||
	 * This isn't callable
 | 
			
		||||
	 * @hidden
 | 
			
		||||
	 * @deprecated
 | 
			
		||||
	 */
 | 
			
		||||
	(): never
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export type CachedQuery<T extends Id[]> = {
 | 
			
		||||
	/**
 | 
			
		||||
	 * Returns an iterator that produces a tuple of [Entity, ...queriedComponents].
 | 
			
		||||
	 */
 | 
			
		||||
	iter(): Iter<T>;
 | 
			
		||||
	iter(): IterFn<T>;
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Returns the matched archetypes of the query
 | 
			
		||||
| 
						 | 
				
			
			@ -75,7 +83,7 @@ export type Query<T extends Id[]> = {
 | 
			
		|||
	/**
 | 
			
		||||
	 * Returns an iterator that produces a tuple of [Entity, ...queriedComponents].
 | 
			
		||||
	 */
 | 
			
		||||
	iter(): Iter<T>;
 | 
			
		||||
	iter(): IterFn<T>;
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Creates and returns a cached version of this query for efficient reuse.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue