tsc v2.6.2
Here's an example from jcormont/documentdb-typescript, Collection.d.ts in attempting to support this new ttl field:
storeDocumentAsync<T extends Partial<_DocumentDB.DocumentResource>>(data: T, mode?: StoreMode, maxRetries?: number, options?: AllOptions): Promise<T & _DocumentDB.DocumentResource>;
...
export interface DocumentResource extends Resource {
ttl?: number;
}
If I opt NOT to include a ttl, I get [ts] Type 'MyDocument' has no properties in common with type 'Partial<DocumentResource>'.
const stored = await myDocuments.storeDocumentAsync(myDocument, StoreMode.CreateOnly);
I can work around it like this, but it is ugly:
const stored = await myDocuments.storeDocumentAsync({ ... myDocument, ttl: undefined }, StoreMode.CreateOnly);