diff --git a/README.md b/README.md index 4fafa5c..de09d4a 100644 --- a/README.md +++ b/README.md @@ -124,11 +124,11 @@ const endPoint = '~~CHANGE_ME_ENDPOINT~~'; /* Load the remote library and get the KR object */ const { KR } = await KRGlue.loadLibrary(endPoint, publicKey) /* Setting configuration */ -await KR.setFormConfig({ 'kr-language': 'en-US' })) +await KR.setFormConfig({ 'kr-language': 'en-US' }) /* Attach a payment form to a given DOM selector */ -const { result } = await KR.attachForm('#myPaymentForm')) +const { result } = await KR.attachForm('#myPaymentForm') /* Show the payment form */ -await KR.showForm(result.formId)); +await KR.showForm(result.formId); ``` > **Note** > diff --git a/index.d.ts b/index.d.ts index 9e0aee1..bda1916 100644 --- a/index.d.ts +++ b/index.d.ts @@ -62,6 +62,13 @@ declare interface KR { attachForm: ( formSelector: string ) => Promise<{ KR: KR; result: { formId: string } }> + /** + * Renders KR in the given selector or HTML element. + * @param $elements - Form query selector or HTML element or array of HTML elements or undefined + */ + renderElements: ( + $elements: string | HTMLElement | Array | undefined + ) => Promise /** * Show form. * @param formId - Form id