import { ICnChar } from 'cnchar-types/main' ; import { IXHY , IInitXHY } from 'cnchar-types/plugin/xhy' ; import { xhy , arg , addXhy , setCnchar } from './xhy' ; function main ( cnchar ) { if ( cnchar . plugins . indexOf ( 'xhy' ) !== - 1 ) { return ; } setCnchar ( cnchar ) ; cnchar . plugins . push ( 'xhy' ) ; cnchar . xhy = xhy ; cnchar . type . xhy = arg ; } const init = ( cnchar ? ) : void => { if ( typeof window === 'object' && ! window . CncharXHY ) { window . CncharXHY = xhy ; } if ( typeof window === 'object' && window . CnChar ) { main ( window . CnChar ) ; } else if ( typeof cnchar !== 'undefined' ) { main ( cnchar ) ; } } ; xhy . init = init ; xhy . addXhy = addXhy ; init ( ) ; export default xhy ;