mirror of
				https://github.com/microsoft/playwright.git
				synced 2025-06-26 21:40:17 +00:00 
			
		
		
		
	 b0749e3a6d
			
		
	
	
		b0749e3a6d
		
			
		
	
	
	
	
		
			
			Currently in our API `?` means null, but sometimes it means optional. Linting optional/nulls with this patch is required for #1166 to land nicely. Previously, return types were not being linted in `api.md`. This is fixed, along with many broken return types. This patch considers `?` to mean nullable, and has some heuristics to determine optionality. I believe this to be the minimal patch needed to unblock #1166. After it lands, we can consider changing the api docs to hopefully remove some heuristics and strangeness.
		
			
				
	
	
		
			19 lines
		
	
	
		
			354 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			354 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| class Foo {
 | |
|   bar(options: {x: number, y: number, maybe?: number, nullable: string|null, object?: {one: number, two?: number}}) {
 | |
| 
 | |
|   }
 | |
| 
 | |
|   async goBack() : Promise<Response | null> {
 | |
|     return null;
 | |
|   }
 | |
| 
 | |
|   response(): Response | null {
 | |
|     return null;
 | |
|   }
 | |
| 
 | |
|   baz(): {abc: number, def?: number, ghi: string} | null {
 | |
|     return null;
 | |
|   }
 | |
| }
 | |
| 
 | |
| export {Foo}; |