nylas
Version:
A NodeJS wrapper for the Nylas REST API for email, contacts, and calendar.
31 lines (30 loc) • 1.54 kB
TypeScript
import { CreateAttachmentRequest } from './models/attachments.js';
export declare function createFileRequestBuilder(filePath: string): CreateAttachmentRequest;
/**
* Encodes the content of each attachment stream to base64.
* @param attachments The attachments to encode.
* @returns The attachments with their content encoded to base64.
*/
export declare function encodeAttachmentStreams(attachments: CreateAttachmentRequest[]): Promise<CreateAttachmentRequest[]>;
/**
* A utility function that recursively converts all keys in an object to camelCase.
* @param obj The object to convert
* @param exclude An array of keys to exclude from conversion
* @returns The converted object
* @ignore Not for public use.
*/
export declare function objKeysToCamelCase(obj: Record<string, unknown>, exclude?: string[]): any;
/**
* A utility function that recursively converts all keys in an object to snake_case.
* @param obj The object to convert
* @param exclude An array of keys to exclude from conversion
* @returns The converted object
*/
export declare function objKeysToSnakeCase(obj: Record<string, unknown>, exclude?: string[]): any;
/**
* A better "Partial" type that makes all properties optional, including nested ones.
* @see https://grrr.tech/posts/2021/typescript-partial/
*/
export type Subset<K> = {
[attr in keyof K]?: K[attr] extends object ? Subset<K[attr]> : K[attr] extends object | null ? Subset<K[attr]> | null : K[attr] extends object | null | undefined ? Subset<K[attr]> | null | undefined : K[attr];
};