If you go to the declaration of Cipher in @types/node, you'll notice that it has subinterfaces that have getAuthTag:
export interface Cipher extends NodeJS.ReadWriteStream {
update(data: string | Buffer | NodeJS.TypedArray | DataView): Buffer;
update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer;
update(data: Buffer | NodeJS.TypedArray | DataView, output_encoding: HexBase64BinaryEncoding): string;
update(data: Buffer | NodeJS.TypedArray | DataView, input_encoding: any, output_encoding: HexBase64BinaryEncoding): string;
// second arg ignored
update(data: string, input_encoding: Utf8AsciiBinaryEncoding, output_encoding: HexBase64BinaryEncoding): string;
final(): Buffer;
final(output_encoding: string): string;
setAutoPadding(auto_padding?: boolean): this;
// getAuthTag(): Buffer;
// setAAD(buffer: Buffer): this; // docs only say buffer
}
export interface CipherCCM extends Cipher {
setAAD(buffer: Buffer, options: { plaintextLength: number }): this;
getAuthTag(): Buffer;
}
export interface CipherGCM extends Cipher {
setAAD(buffer: Buffer, options?: { plaintextLength: number }): this;
getAuthTag(): Buffer;
}
And createCipheriv has corresponding overloads:
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/index.d.ts#L5914-L5916
export function createCipheriv(algorithm: CipherCCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): CipherCCM;
export function createCipheriv(algorithm: CipherGCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options?: CipherGCMOptions): CipherGCM;
export function createCipheriv(algorithm: string, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Cipher;
So if you pass an algorithm argument that is known at compile time to belong to CipherGCMTypes, then you should be able to call getAuthTag. If it's not working, please add your code to the question.