import { DaffExternalScript } from '@daffodil/core/external-script'
Represents the structure of an external script that can be loaded into a document.
interface DaffExternalScript {
src: string
async: boolean
defer: boolean
__index(key: any): any
}
src string |
---|
The source URL of the script. |
async boolean |
---|
Optional. Indicates whether the script should be loaded asynchronously. |
defer boolean |
---|
Optional. Indicates whether the script should be deferred in loading. |
any
Optional. Custom attributes for the script. The keys must start with 'data-' followed by any string.
Parameter | key: any |
---|---|
Description |
const externalScript: DaffExternalScript = {
src: 'https://example.com/script.js',
async: true,
defer: false,
'data-custom-attribute': 'value',
};