mowispace / react-native-logs

Performance-aware simple logger for React-Native and Expo with namespaces, custom levels and custom transports (colored console, file writing, etc.)
MIT License
460 stars 33 forks source link

Typescript complaints about logger definition #102

Open rpinto-immfly opened 3 months ago

rpinto-immfly commented 3 months ago

Just by using the simplest example, typescript complaints about the private properties:


  logger,
  consoleTransport,
  fileAsyncTransport,
  configLoggerType,
} from 'react-native-logs'
import * as FileSystem from 'expo-file-system'

const config: configLoggerType = {
  transport: __DEV__ ? consoleTransport : fileAsyncTransport,
  severity: __DEV__ ? 'debug' : 'error',
  transportOptions: {
    colors: {
      info: 'blueBright',
      warn: 'yellowBright',
      error: 'redBright',
    },
    FS: FileSystem,
  },
}

const log = logger.createLogger(config)

export { log }```

Property '_async' of exported class expression may not be private or protected.ts(4094)
Property '_asyncFunc' of exported class expression may not be private or protected.ts(4094)
Property '_dateFormat' of exported class expression may not be private or protected.ts(4094)
Property '_disabledExtensions' of exported class expression may not be private or protected.ts(4094)
Property '_enabled' of exported class expression may not be private or protected.ts(4094)
Property '_enabledExtensions' of exported class expression may not be private or protected.ts(4094)
Property '_extendedLogs' of exported class expression may not be private or protected.ts(4094)
Property '_extensions' of exported class expression may not be private or protected.ts(4094)
Property '_fixedExtLvlLength' of exported class expression may not be private or protected.ts(4094)
Property '_formatFunc' of exported class expression may not be private or protected.ts(4094)
Property '_formatMsg' of exported class expression may not be private or protected.ts(4094)
Property '_isExtensionEnabled' of exported class expression may not be private or protected.ts(4094)
Property '_isLevelEnabled' of exported class expression may not be private or protected.ts(4094)
Property '_level' of exported class expression may not be private or protected.ts(4094)
Property '_levels' of exported class expression may not be private or protected.ts(4094)
Property '_log' of exported class expression may not be private or protected.ts(4094)
Property '_maxExtensionsChars' of exported class expression may not be private or protected.ts(4094)
Property '_maxLevelsChars' of exported class expression may not be private or protected.ts(4094)
Property '_originalConsole' of exported class expression may not be private or protected.ts(4094)
Property '_printDate' of exported class expression may not be private or protected.ts(4094)
Property '_printLevel' of exported class expression may not be private or protected.ts(4094)
Property '_sendToTransport' of exported class expression may not be private or protected.ts(4094)
Property '_stringifyFunc' of exported class expression may not be private or protected.ts(4094)
Property '_stringifyMsg' of exported class expression may not be private or protected.ts(4094)
Property '_transport' of exported class expression may not be private or protected.ts(4094)
Property '_transportOptions' of exported class expression may not be private or protected.ts(4094)
const log: Omit<logs, "extend"> & {
    [x: string]: (...args: unknown[]) => void;
} & {
    extend: (extension: string) => { [key in string]: (...args: unknown[]) => void; };
}
jp-amz commented 3 months ago

Try a .js instead