import { PublicKey } from "./PublicKey.mjs";
import { Ed25119Sig2018 } from "./Ed25119Sig2018.mjs";
import { EddsaSaSigSecp256k1 } from "./EddsaSaSigSecp256k1.mjs";
import { RsaSig2018 } from "./RsaSig2018.mjs";
import { Transform, plainToInstance } from "class-transformer";

//#region ../didcomm/src/modules/connections/models/did/publicKey/index.ts
const publicKeyTypes = {
	RsaVerificationKey2018: RsaSig2018,
	Ed25519VerificationKey2018: Ed25119Sig2018,
	Secp256k1VerificationKey2018: EddsaSaSigSecp256k1
};
/**
* Decorator that transforms public key json to corresonding class instances. See {@link publicKeyTypes}
*
* @example
* class Example {
*   ＠PublicKeyTransformer()
*   private publicKey: PublicKey
* }
*/
function PublicKeyTransformer() {
	return Transform(({ value }) => {
		return value.map((publicKeyJson) => {
			return plainToInstance(publicKeyTypes[publicKeyJson.type] ?? PublicKey, publicKeyJson);
		});
	}, { toClassOnly: true });
}

//#endregion
export { PublicKeyTransformer, publicKeyTypes };
//# sourceMappingURL=index.mjs.map